package com.yunji.common.convert;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.yunji.common.utils.DecimalUtils;

import java.io.IOException;
import java.math.BigDecimal;

/**
 * @author : peter-zhu
 * @date : 2025/1/6 16:50
 * @description : TODO
 **/
public class DecimalLeftTwo  extends JsonSerializer<BigDecimal> {

    @Override
    public void serialize(BigDecimal value, JsonGenerator gen, SerializerProvider serializerProvider) throws IOException {
        gen.writeNumber(DecimalUtils.leftTwo(value));
    }
}
